﻿<!--
Name:找回密码-重设密码
Page:ALL
-->
<div class="nbbox clearfix">
<div class="userbox">
    <div class="mt clearfix">
        <h2>{tag:找回密码}</h2>
    </div>
    <div class="mc clearfix">
    <div class="dl-table clearfix">
    <%if (type == 1){ %>
    <%int i=1;foreach (Shop.Model.Lebi_User_Answer model in user_answers){%>
    <dl>
        <dt>{tag:问题}：</dt>
        <dd><input type="hidden" name="Question_id<%=i %>" id="Question_id<%=i %>" value="<%=model.User_Question_id%>" shop="true" />
		<%=QuestionName(model.User_Question_id) %></dd>
    </dl>
    <dl>
        <dt>{tag:答案}：</dt>
        <dd><input type="text" id="Answer<%=i %>" name="Answer<%=i %>" size="30" class="input" value="" min="notnull" shop="true" /></dd>
    </dl>
    <%i++;} %>
    <%} %>
    <dl>
        <dt>{tag:新密码}：</dt>
        <dd><input name="PWD" id="PWD" shop="true" type="password" size="30" class="input" />
        <span id="FormPWD"></span></dd>
    </dl>
    <dl>
        <dt>{tag:确认密码}：</dt>
        <dd><input name="RPWD" id="RPWD" shop="true" type="password" size="30" class="input" />
        <span id="FormRPWD"></span></dd>
    </dl>
    <dl class="dl-btn">
        <dt></dt>
        <dd><a href="javascript:void(0)" onclick="submit();" class="btn btn-11"><s></s>{tag:提交}</a>
        <input name="id" id="id" shop="true" type="hidden" value="<%=Rint("id") %>" />
        <input name="email" id="email" shop="true" type="hidden" value="<%=Rstring("id") %>" />
        <input name="checkcode" id="checkcode" shop="true" type="hidden" value="<%=Rstring("v") %>" /></dd>
    </dl>
    <dl class="dl-msg">
        <dt></dt>
        <dd><div id="msg"></div></dd>
    </dl>
    </div>
    </div>
</div>
</div>
<script type="text/javascript">
    function submit() {
        var PWD = $("#PWD").val();
        var RPWD = $("#RPWD").val();
        <%if (type == 1){ %>
        var Answer1 = $("#Answer1").val();
        var Answer2 = $("#Answer2").val();
        if (Answer1 == "") {
            CheckNO("Answer1", "{tag:请回答答案}");
            return false;
        }
        if (Answer2 == "") {
            CheckNO("Answer2", "{tag:请回答答案}");
            return false;
        }
        <%} %>
        if (PWD == "") {
            CheckNO("PWD", "{tag:密码不能为空}");
            return false;
        }
        if (PWD != RPWD) {
            CheckNO("RPWD", "{tag:两次输入的密码不一致}");
            return false;
        }
        var postData = GetFormJsonData("shop");
        var url = path+"/ajax/ajax_user.aspx?__Action=User_resetpwd&v=<%=v%>&type=<%=type %>";
        RequestAjax(url, postData, function () { MsgBox(1, "{tag:密码修改成功，请登录}", "<%=URL("P_Login","")%>") });
    }
</script>